package com.panku.controller;

import com.panku.common.vo.Result;
import com.panku.entity.Order;
import com.panku.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: jack
 * @Description:
 * @Date Create in 9:43 2021-02-02
 **/
@RequestMapping("/order")
@RestController
public class OrderController {

    @Autowired
    private IOrderService orderService;

    @PostMapping("/add/{uid}/{pid}/{nums}")
    public void add(@PathVariable Integer uid, @PathVariable Integer pid, @PathVariable Integer nums) {
        orderService.saveOrder(uid, pid, nums);
    }

    @PostMapping("/get/{oid}")
    public Order get(@PathVariable Long oid) {
        return orderService.get(oid);

    }

}
